//
//  IGUserDefaults.m
//  jingdongfang
//
//  Created by BOE on 2018/1/12.
//  Copyright © 2018年 LJL. All rights reserved.
//

#import "IGUserDefaults.h"

@implementation IGUserDefaults

+ (instancetype)shareIGUserDefaults {
    static IGUserDefaults *userDafault = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        userDafault = [[IGUserDefaults alloc] init];
    });
    return userDafault;
}

- (void)userDefaultsForBool:(BOOL)vaule forKey:(NSString *)key{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setObject:@(vaule) forKey:key];
    [userDefaults synchronize];
}

- (BOOL)getUserDefaultsBoolForKey:(NSString *)key{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    return [userDefaults boolForKey:key];
}

- (void)setLoginStatus:(BOOL)loginStatus {
    [self userDefaultsForBool:loginStatus forKey:@"loginStatus"];
}

- (BOOL)getLoginStatus {
    return [self getUserDefaultsBoolForKey:@"loginStatus"];
}

- (void)userDefaults:(NSString *)vaule forKey:(NSString *)key{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setObject:vaule forKey:key];
    [userDefaults synchronize];
}

- (NSString *)getUserDefaultsForKey:(NSString *)key{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSString *value = [userDefaults valueForKey:key];
    return value;
}

- (void)setUid:(NSString *)uid {
    [self userDefaults:uid forKey:@"uid"];
}

- (NSString *)getUid {
    return [self getUserDefaultsForKey:@"uid"];
}

- (void)setNike:(NSString *)nike {
    [self userDefaults:nike forKey:@"nike"];
}

- (NSString *)getNike {
    return [self getUserDefaultsForKey:@"nike"];
}

- (void)setImage:(NSString *)image {
    [self userDefaults:image forKey:@"image"];
}

- (NSString *)getImage {
    return [self getUserDefaultsForKey:@"image"];
}

- (void)setCollectionNums:(NSString *)collectionNums {
    [self userDefaults:collectionNums forKey:@"collectionNums"];
}

- (NSString *)getCollectionNums {
    return [self getUserDefaultsForKey:@"collectionNums"];
}

- (void)setFollowNums:(NSString *)followNums {
    [self userDefaults:followNums forKey:@"followNums"];
}

- (NSString *)getFollowNums {
    return [self getUserDefaultsForKey:@"followNums"];
}

- (void)setWorksNums:(NSString *)worksNums {
    [self userDefaults:worksNums forKey:@"worksNums"];
}

- (NSString *)getWorksNums {
    return [self getUserDefaultsForKey:@"worksNums"];
}

- (void)setFocusNums:(NSString *)focusNums {
    [self userDefaults:focusNums forKey:@"focusNums"];
}

- (NSString *)getFocusNums {
    return [self getUserDefaultsForKey:@"focusNums"];
}

- (void)setTotalEquNums:(NSString *)totalEquNums {
    [self userDefaults:totalEquNums forKey:@"totalEquNums"];
}

- (NSString *)getTotalEquNums {
    return [self getUserDefaultsForKey:@"totalEquNums"];
}

- (void)setAlbumNums:(NSString *)albumNums {
    [self userDefaults:albumNums forKey:@"albumNums"];
}

- (NSString *)getAlbumNums {
    return [self getUserDefaultsForKey:@"albumNums"];
}

- (void)setContent:(NSString *)content {
    [self userDefaults:content forKey:@"content"];
}

- (NSString *)getContent {
    return [self getUserDefaultsForKey:@"content"];
}

- (void)setTel:(NSString *)tel {
    [self userDefaults:tel forKey:@"tel"];
}

- (NSString *)getTel {
    return [self getUserDefaultsForKey:@"tel"];
}

- (void)setUToken:(NSString *)uToken {
    [self userDefaults:uToken forKey:@"uToken"];
}

- (NSString *)getUToken {
    return [self getUserDefaultsForKey:@"uToken"];
}

- (void)setType:(NSString *)type {
    [self userDefaults:type forKey:@"type"];
}

- (NSString *)getType {
    return [self getUserDefaultsForKey:@"type"];
}

- (void)setAuthens:(NSString *)authens {
    [self userDefaults:authens forKey:@"authens"];
}

- (NSString *)getAuthens {
    return [self getUserDefaultsForKey:@"authens"];
}

- (void)setAuthensContent:(NSString *)authensContent {
    [self userDefaults:authensContent forKey:@"authensContent"];
}

- (NSString *)getAuthensContent {
    return [self getUserDefaultsForKey:@"authensContent"];
}

- (void)setUnReadTotal:(NSString *)unReadTotal {
    [self userDefaults:unReadTotal forKey:@"unReadTotal"];
}

- (NSString *)getUnReadTotal {
    return [self getUserDefaultsForKey:@"unReadTotal"];
}
@end
